module.exports = {
    12123: {
        pageTitle: '农技咨询管理 | 新增专家/编辑专家',
        create: {
            url: {
                method: 'get',
                module: 'productBrand',
                value: 'getBaseData'
            },
            beforeAjax(payload) {
                payload['?????????我是beforeAjax的数据'] = Math.random().toString(32)
                // return '#$%^&*from beforeAjax'
            },
        },
        form: {
            style: {
                width: '80%',
            },
            props: {
                // size: 'small',
            },
        },
        parts: [
            {
                title: '基本信息',
                fields: [{
                    required: true,
                    model: 'companyName',
                    label: '公司名称',
                    component: {
                        type: 'el-input',
                    },
                }],
            }, {
                title: '其它信息',
                fields: [
                    {
                        required: true,
                        model: '级联',
                        label: '级联',
                        component: {
                            type: 'select-grade',
                            length: 4,

                            label: 'name',
                            value: 'code',
                            api: {
                                url: {
                                    method: 'get',
                                    module: 'productBrand',
                                    value: 'getBaseData'
                                },
                                dataField: 'obj.list',

                                levelField: 'level',
                                parentField: 'parentCode',
                            },
                        },
                    },
                    {
                        required: true,
                        model: '文件上传',
                        label: '文件上传',
                        component: {
                            type: 'upload:files',
                        },
                    },
                    {
                        required: true,
                        model: '富文本',
                        label: '富文本',
                        component: {
                            type: 'wangeditor',
                        },
                    },
                    {
                        required: true,
                        model: '专家姓名',
                        label: '专家姓名',
                        size: 12,
                        component: {
                            type: 'el-input',
                        },
                    },
                    {
                        required: true,
                        model: '账户',
                        label: '账户',
                        size: 12,
                        tip: '用于登录专家APP',
                        component: {
                            type: 'el-input',
                        },
                    },
                    {
                        required: true,
                        model: '专家类型',
                        label: '专家类型',
                        size: 12,
                        component: {
                            type: 'select',

                            label: 'label',
                            value: 'value',
                            options: [
                                {
                                    value: '选项1',
                                    label: '黄金糕'
                                }, {
                                    value: '选项2',
                                    label: '双皮奶',
                                }, {
                                    value: '选项3',
                                    label: '蚵仔煎'
                                }, {
                                    value: '选项4',
                                    label: '龙须面'
                                }, {
                                    value: '选项5',
                                    label: '北京烤鸭'
                                }
                            ],
                        },
                    },
                    {
                        required: true,
                        model: '用户密码',
                        label: '用户密码',
                        size: 12,
                        tip: '随机生成8位密码，编辑用户时如不填写，则不修改用户密码',
                        component: {
                            type: 'el-input',
                            props: {
                                type: 'password',
                            },
                        },
                    },
                    {
                        required: true,
                        model: '专家头衔',
                        label: '专家头衔',
                        component: {
                            type: 'el-input',
                        },
                    },
                    {
                        required: true,
                        model: '专家专长',
                        label: '专家专长',
                        component: {
                            type: 'select',
                            async: true,

                            label: 'name',
                            value: 'code',
                            api: {
                                url: {
                                    method: 'get',
                                    module: 'productBrand',
                                    value: 'getBaseData'
                                },
                                dataField: 'obj.classify.list',
                                payload: {
                                    level: 1,
                                    parentCode: '',
                                }
                            },
                            props: {
                                multiple: true,
                            },
                        },
                    },
                    {
                        required: true,
                        model: '专家简介',
                        label: '专家简介',
                        component: {
                            type: 'textarea',
                            maxlength: 200,
                        },
                    },
                    {
                        required: true,
                        validator: 'phone',
                        model: '联系方式',
                        label: '联系方式',
                        component: {
                            type: 'el-input',
                        },
                    },
                    // 测试组件
                    {
                        required: true,
                        model: '联系方式222',
                        label: '联系方式222',
                        component: {
                            type: 'phone',
                        },
                    },
                    {
                        required: true,
                        model: '评分',
                        label: '评分',
                        component: {
                            type: 'number',
                            props: {
                                controls: false,
                                min: 1,
                                max: 5,
                                placeholder: '请输入0-5的数字'
                            },
                        },
                    },
                    {
                        required: true,
                        model: '咨询量',
                        label: '咨询量',
                        component: {
                            type: 'number',
                            props: {
                                controls: false,
                                max: 999999999,
                                placeholder: '0-999999999，数字填写',
                            },
                        },
                    },
                    {
                        rules: [
                            {
                                required: true,
                            },
                            {
                                required: false,
                            }
                        ],
                        model: '专家头像',
                        label: '专家头像',
                        component: {
                            type: 'upload:img',
                        },
                    },
                    {
                        rules: [
                            {
                                required: true,
                                validator(rule, value, cb) {
                                    console.log(arguments)
                                    cb()
                                },
                            }
                        ],
                        // scope: true,
                        model: '专家详细介绍',
                        label: '专家详细介绍',
                        fields: [
                            // 1
                            {
                                model: '专家头像45',
                                // scope: true,
                                fields: [
                                    // 1
                                    {
                                        label: '专家头像4532222',
                                        model: '专家头像4532222',
                                        component: {
                                            type: 'upload:imgs',
                                        },
                                    },
                                ],
                            },
                            {
                                model: '专家简介345',
                                component: {
                                    type: 'textarea',
                                    maxlength: 200,
                                },
                            },
                            // 2
                            {
                                model: '专家头像2435',
                                component: {
                                    type: 'upload:imgs',
                                },
                            },
                            {
                                model: '专家简介3452',
                                component: {
                                    type: 'textarea',
                                    maxlength: 200,
                                },
                            },
                            // 3
                            {
                                model: '专家头像4353',
                                component: {
                                    type: 'upload:imgs',
                                },
                            },
                            {
                                model: '专家简介34533',
                                component: {
                                    type: 'textarea',
                                    maxlength: 200,
                                },
                            },
                        ],
                    },
                ],
            }],
    },
    page: {
        // 获取详情数据，暂时全部用id获取，方便使用
        modelUrl: {
            method: 'get',
            module: 'admin',
            value: 'getDetailsById',
        },
        /* 生命周期 */
        // 离开
        cancel: {
            text: '我是返回按钮',
            to: '/home/dynamicList/page',
        },
        // 新增
        create: {
            text: '新增',
            url: {
                method: 'get',
                module: 'admin',
                value: 'getDetailsById'
            },
            beforeAjax(payload) {
                alert('新增新增中------------')
                // payload['?????????我是beforeAjax的数据'] = Math.random().toString(32)
                // return '#$%^&*from beforeAjax'
            },
        },
        // 编辑
        edit: {
            text: '保存',
            url: {
                method: 'get',
                module: 'admin',
                value: 'getDetailsById'
            },
            beforeAjax(payload) {
                alert('编辑编辑中------------')
                // payload['?????????我是beforeAjax的数据'] = Math.random().toString(32)
                // return '#$%^&*from beforeAjax'
            },
        },
        fields: [
            {
                required: true,
                model: 'companyName',
                label: '公司名称',
                component: {
                    type: 'el-input',
                },
            },
            {
                required: true,
                model: 'companyAddress',
                label: '公司地址',
                component: {
                    type: 'el-input',
                },
            },
            {
                required: true,
                model: 'photo',
                label: '联系头像',
                component: {
                    type: 'upload:img',
                },
            },
            {
                required: true,
                model: 'linkman',
                label: '联系人',
                component: {
                    type: 'el-input',
                },
            },
            {
                required: true,
                model: 'contactPhone',
                label: '联系方式',
                component: {
                    type: 'phone',
                },
            },
            {
                required: true,
                model: 'cooperationAmount',
                label: '数字1',
                component: {
                    type: 'number',
                },
            },
            {
                required: true,
                model: 'purchaseAmount',
                label: '数字2',
                component: {
                    type: 'number',
                },
            },
        ],
    },
}
